home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / glibc108.zip / glibc108 / configure < prev    next >
Text File  |  1994-05-20  |  22KB  |  783 lines

  1. #! /bin/sh
  2.  
  3. # Configuration script for the GNU C Library.
  4. # DO NOT EDIT!  This script is generated from configure.in; edit that instead.
  5.  
  6. # Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
  7. # This file is part of the GNU C Library.
  8.  
  9. # The GNU C Library is free software; you can redistribute it and/or
  10. # modify it under the terms of the GNU Library General Public License as
  11. # published by the Free Software Foundation; either version 2 of the
  12. # License, or (at your option) any later version.
  13.  
  14. # The GNU C Library is distributed in the hope that it will be useful,
  15. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  17. # Library General Public License for more details.
  18.  
  19. # You should have received a copy of the GNU Library General Public
  20. # License along with the GNU C Library; see the file COPYING.LIB.  If
  21. # not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  22. # Cambridge, MA 02139, USA.
  23.  
  24. #
  25. #    Configure the GNU C Library.
  26. #
  27.  
  28. prog="`basename $0`"
  29.  
  30. # All the standard GNU configure options are accepted but only
  31. # --nfp, --with-gnu-ld, and --with-gnu-as are meaningful.
  32. nfp=
  33. gnu_ld=
  34. gnu_as=
  35. prefix=
  36. exec_prefix=
  37. verbose=
  38.  
  39. next=
  40. lose=
  41. for arg in $*; do
  42.   if [ x$next != x ]; then
  43.     eval "$next=\$arg"
  44.     next=
  45.   else
  46.     case $arg in
  47.     -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  48.        srcdir=`echo $arg | sed 's/-*s[a-z]*=//'`
  49.        ;;
  50.     -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  51.        next=srcdir
  52.        ;;
  53.     -target | --target | --targe | --targ | --tar | --ta | --t)
  54.        next=target
  55.        ;;
  56.     -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
  57.        target=`echo $arg | sed 's/-*t[a-z]*=//'`
  58.        ;; 
  59.  
  60.     -with-gnu-ld | --with-gnu-ld | --with-gnu-l)
  61.        gnu_ld=--with-gnu-ld
  62.        ;;
  63.  
  64.     -gas | --gas | --ga | --g | -with-gnu-as | --with-gnu-as | -with-gnu-a)
  65.        gnu_as=--with-gnu-as
  66.        ;;
  67.  
  68.     -nfp | --nfp | --nf | --n)
  69.        nfp=--nfp
  70.        ;;
  71.  
  72.     -with-* | --with-*)
  73.       # For `--with-foo=bar', do "with_foo='bar'".
  74.       # For `--with-fnord', do "with_fnord=yes".
  75.       # These variables may be examined by sysdep configure fragments.
  76.       eval `echo "$arg" | sed '{s/^-*//;s/-/_/g
  77. s/^\([^=]*\)=\(.*\)$/\1='\''\2'\''/;s/^\([^=]*\)$/\1=yes/;}'`
  78.       ;;
  79.  
  80.     -x | --x)
  81.       ;; # ignored
  82.  
  83.     # For backward compatibility, also recognize exact --exec_prefix.
  84.     -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  85.        exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'`
  86.        ;;
  87.     -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  88.        next=exec_prefix
  89.        ;;
  90.  
  91.     -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  92.        prefix=`echo $arg | sed 's/[-a-z_]*=//'`
  93.        ;;
  94.     -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  95.        next=prefix
  96.        ;;
  97.  
  98.     -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  99.       # Autoconf-generated code below will test this.
  100.       verbose=yes
  101.       ;;
  102.  
  103.     -*)
  104.        echo "Invalid option \`$arg'" 1>&2
  105.        lose=yes
  106.        ;;
  107.     *)
  108.        if [ ! "$target" ]; then
  109.      target=$arg
  110.        else
  111.      lose=yes
  112.        fi
  113.        ;;
  114.     esac
  115.   fi
  116. done
  117.  
  118. # NEXT will be set iff we have seen an option that wants an arg, but no arg.
  119. if [ "$next" ]; then
  120.   echo "$0: the \`--${next}' option requires an argument" >&2
  121.   lose=yes
  122. fi
  123.  
  124.  
  125. trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15
  126. trap 'rm -fr confdefs* $ac_clean_files' 0
  127.  
  128. # Save the original args if we used an alternate arg parser.
  129. ac_configure_temp="${configure_args-$*}"
  130. # Strip out --no-create and --norecursion so they don't pile up.
  131. configure_args=
  132. for ac_arg in $ac_configure_temp; do
  133.   case "$ac_arg" in
  134.   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  135.   | --no-cr | --no-c) ;;
  136.   -norecursion | --norecursion | --norecursio | --norecursi \
  137.   | --norecurs | --norecur | --norecu | --norec | --nore | --nor) ;;
  138.   *) configure_args="$configure_args $ac_arg" ;;
  139.   esac
  140. done
  141.  
  142. # NLS nuisances.
  143. # These must not be set unconditionally because not all systems understand
  144. # e.g. LANG=C (notably SCO).
  145. if test "${LC_ALL+set}" = 'set'; then LC_ALL=C; export LC_ALL; fi
  146. if test "${LANG+set}"   = 'set'; then LANG=C;   export LANG;   fi
  147.  
  148. # confdefs.h avoids OS command line length limits that DEFS can exceed.
  149. rm -rf conftest* confdefs.h
  150. # AIX cpp loses on an empty file, so make sure it contains at least a newline.
  151. echo > confdefs.h
  152.  
  153. # A filename unique to this package, relative to the directory that
  154. # configure is in, which we can look for to find out if srcdir is correct.
  155. ac_unique_file=features.h
  156.  
  157. # Find the source files, if location was not specified.
  158. if test -z "$srcdir"; then
  159.   ac_srcdir_defaulted=yes
  160.   # Try the directory containing this script, then `..'.
  161.   ac_prog=$0
  162.   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
  163.   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
  164.   srcdir=$ac_confdir
  165.   if test ! -r $srcdir/$ac_unique_file; then
  166.     srcdir=..
  167.   fi
  168. fi
  169. if test ! -r $srcdir/$ac_unique_file; then
  170.   if test x$ac_srcdir_defaulted = xyes; then
  171.     echo "configure: can not find sources in ${ac_confdir} or .." >&2; exit 1
  172.   else
  173.     echo "configure: can not find sources in ${srcdir}" >&2; exit 1
  174.   fi
  175. fi
  176. ac_ext=c
  177. # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
  178. ac_cpp='${CPP}'
  179. ac_compile='${CC-cc} $CFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS >/dev/null 2>&1'
  180.  
  181.  
  182. ac_ext=c
  183. # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
  184. ac_cpp='${CPP}'
  185. ac_compile='${CC-cc} $CFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS >/dev/null 2>&1'
  186.  
  187.  
  188.  
  189. # Decanonicalize srcdir so we can tell when we are configuring in srcdir.
  190. if [ "`(cd ${srcdir}; pwd)`" = "`pwd`" ]; then
  191.   srcdir=.
  192. fi
  193.  
  194. if [ ! "$target" ]; then
  195.   target=`$srcdir/config.guess`
  196.   test -n "$target" && echo "No target given; guessing target is ${target}."
  197. fi
  198.  
  199. if [ "$lose" = yes -o ! "$target" ]; then
  200.   echo "\
  201. Usage: $prog [--srcdir=DIR] [--prefix=DIR] [--exec-prefix=DIR]
  202.          [--nfp] [--with-gnu-ld] [--with-gnu-as] TARGET" >&2
  203.   if [ -r config.status ]; then
  204.     cat config.status >&2
  205.   fi
  206.   exit 1
  207. fi
  208.  
  209. # Done parsing the arguments.
  210.  
  211. # This will get text that should go into config.make.
  212. config_vars=
  213.  
  214. # Check for a --with-gmp argument and set gmp-srcdir in config.make.
  215. case "$with_gmp" in
  216. yes) echo "$prog: --with-gmp requires an argument; use --with-gmp=DIRECTORY"
  217.      exit 1 ;;
  218. '') ;;
  219. *) config_vars="$config_vars
  220. gmp-srcdir = $with_gmp" ;;
  221. esac
  222.  
  223. # Canonicalize the configuration name.
  224. config=`$srcdir/config.sub $target`
  225. if [ ! "$config" ]; then
  226.   # config.sub has written an error message.
  227.   exit 1
  228. fi
  229.  
  230. sysdep_dir=$srcdir/sysdeps
  231.  
  232. # machine-vendor-os
  233. eval "`echo $config | \
  234.        sed 's/^\(.*\)-\(.*\)-\(.*\)$/\
  235. config_machine=\1 config_vendor=\2 config_os=\3/'`"
  236.  
  237. # We keep the original values in `$config_*' and never modify them, so we
  238. # can write them unchanged into config.make.  Everything else uses
  239. # $machine, $vendor, and $os, and changes them whenever convenient.
  240. machine=$config_machine
  241. vendor=$config_vendor
  242. os=$config_os
  243.  
  244. # Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1.
  245. os="`echo $os | sed 's/\([0-9A-Z]\)[v_]\([0-9A-Z]\)/\1.\2/g'`"
  246.  
  247. case "$machine" in
  248. i[34]86)
  249.   machine=i386/$machine ;;
  250. sparc[6789])
  251.   machine=sparc/$machine ;;
  252. m68k)
  253.   machine=m68k/m68020 ;;
  254. m680?0)
  255.   machine=m68k/$machine ;;
  256. m88k)
  257.   machine=m88k/m88100 ;;
  258. m88???)
  259.   machine=m88k/$machine ;;
  260. mips|r2000)
  261.   machine=mips/r3000 ;;
  262. r[34]000)
  263.   machine=mips/$machine ;;
  264. esac
  265.  
  266. case "$os" in
  267. gnu*)
  268.   base_os=mach/hurd ;;
  269. netbsd* | 386bsd*)
  270.   base_os=unix/bsd/bsd4.4 ;;
  271. osf1* | sunos* | ultrix* | newsos* | dynix* | *bsd*)
  272.   base_os=unix/bsd ;;
  273. linux* | sysv* | isc* | esix* | sco* | minix* | irix4*)
  274.   base_os=unix/sysv ;;
  275. solaris[2-9]*)
  276.   base_os=unix/sysv/sysv4 ;;
  277. esac
  278.  
  279. case "$os:$base_os" in
  280. gnu* | linux* | bsd4.4* | *:bsd4.4)
  281.   gnu_ld=--with-gnu-ld
  282.   gnu_as=--with-gnu-as
  283. esac
  284.  
  285. # For sunos4.1.1, try sunos4.1.1, then sunos4.1, then sunos4, then sunos.
  286. tail=$os
  287. ostry=$os
  288. while o=`echo $tail | sed 's/\.[^.]*$//'`; [ $o != $tail ]; do
  289.   ostry="$ostry /$o"
  290.   tail=$o
  291. done  
  292. o=`echo $tail | sed 's/[0-9]*$//'`
  293. if [ $o != $tail ]; then
  294.   ostry="$ostry /$o"
  295. fi
  296.  
  297. # For unix/sysv/sysv4, try unix/sysv/sysv4, then unix/sysv, then unix.
  298. base=
  299. tail=$base_os
  300. while b=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; [ "$b" ]; do
  301.   set $b
  302.   base="$base /$1"
  303.   tail="$2"
  304. done
  305.  
  306. # For sparc/sparc9, try sparc/sparc9 and then sparc.
  307. mach=
  308. tail=$machine
  309. while m=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; [ "$m" ]; do
  310.   set $m
  311.   mach="$mach /$1"
  312.   tail="$2"
  313. done
  314.  
  315. # Find what sysdep directories exist.
  316. sysnames=
  317. for b in $base ''; do
  318.   for v in /$vendor ''; do
  319.     for o in /$ostry ''; do
  320.       for m in $mach ''; do
  321.         if [ -d $sysdep_dir$b$v$o$m ]; then
  322.           sysnames="$sysnames $b$v$o$m"
  323.       [ "$o" -o "$b" ] && os_used=t
  324.       [ "$m" ] && machine_used=t
  325.     fi
  326.       done
  327.     done
  328.   done
  329. done
  330.  
  331. if [ ! "$os_used" -a "$os" != none ]; then
  332.   echo Operating system $os is not supported. >&2
  333.   exit 1
  334. fi
  335. if [ ! "$machine_used" -a "$machine" != none ]; then
  336.   echo The $machine is not supported. >&2
  337.   exit 1
  338. fi
  339.  
  340. # We have now validated the configuration.
  341.  
  342. PWD=`pwd`
  343. echo Configuring the GNU C library in $PWD
  344. echo on `(hostname || uname -n) 2>/dev/null | sed 1q` for ${config}.
  345.  
  346. # Remove the leading slashes.
  347. sysnames="`echo $sysnames | sed -e 's@^/@@' -e 's@ /@ @g'`"
  348.  
  349. # Prepend the machine's FPU directory unless --nfp.
  350. if [ ! "$nfp" -a -d $sysdep_dir/$machine/fpu ]; then
  351.   sysnames="${machine}/fpu $sysnames"
  352. fi
  353.  
  354. # Expand the list of system names into a full list of directories
  355. # from each element's parent name and Implies file (if present).
  356. set $sysnames
  357. while [ $# -gt 0 ]; do
  358.   name=$1
  359.   shift
  360.  
  361.   if [ -f $sysdep_dir/$name/Implies ]; then
  362.     # Collect more names from the `Implies' file (removing comments).
  363.     implied="`sed 's/#.*$//' < $sysdep_dir/$name/Implies`"
  364.     for x in $implied; do
  365.       test -d $sysdep_dir/$x || echo "Warning: $name implies nonexistent $x">&2
  366.     done
  367.   else
  368.     implied=
  369.   fi
  370.  
  371.   # Add NAME to the list of names.
  372.   names="$names $name"
  373.  
  374.   # Find the parent of NAME, using the empty string if it has none.
  375.   parent="`echo $name | sed -n -e '/\//!q' -e 's=/[^/]*$==p'`"
  376.  
  377.   # Add the names implied by NAME, and NAME's parent (if it has one), to
  378.   # the list of names to be processed (the argument list).  We prepend the
  379.   # implied names to the list and append the parent.  We want implied
  380.   # directories to come before further directories inferred from the
  381.   # configuration components; this ensures that for sysv4, unix/common
  382.   # (implied by unix/sysv/sysv4) comes before unix/sysv (in ostry (here $*)
  383.   # after sysv4).
  384.   sysnames="`echo $implied $* $parent`"
  385.   if [ "$sysnames" != "" ]; then
  386.     set $sysnames
  387.   fi
  388. done
  389.  
  390. # Add the default directories.
  391. names="$names generic stub"
  392.  
  393. # Now uniquize the list.
  394. seen=
  395. sysnames=
  396. for name in $names; do
  397.   if echo "$seen" | fgrep -x $name >/dev/null; then
  398.     # Already in the list.
  399.     true;
  400.   else
  401.     # A new one.
  402.     if [ "$seen" = "" ]; then
  403.       seen="$name" sysnames="$name"
  404.     else
  405.       seen="$seen
  406. $name"
  407.       sysnames="$sysnames $name"
  408.     fi
  409.   fi
  410. done
  411.  
  412. echo Using system-dependent files from directories:
  413. for dir in $sysnames; do echo "    $dir"; done
  414.  
  415.  
  416.  
  417. # Make sure to not get the incompatible SysV /etc/install and
  418. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  419. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  420. # or the AFS install, which mishandles nonexistent args, or
  421. # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  422. # `staff', or /sbin/install on IRIX which has incompatible command-line
  423. # syntax.  Sigh.
  424. #
  425. #     On most BSDish systems install is in /usr/bin, not /usr/ucb
  426. #     anyway.
  427. # This turns out not to be true, so the mere pathname isn't an indication
  428. # of whether the program works.  What we really need is a set of tests for
  429. # the install program to see if it actually works in all the required ways.
  430. #
  431. # Avoid using ./install, which might have been erroneously created
  432. # by make from ./install.sh.
  433. if test -z "${INSTALL}"; then
  434.   test -n "$silent" || echo "checking for a BSD compatible install"
  435.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  436.   for ac_dir in $PATH; do
  437.     case "$ac_dir" in
  438.     ''|.|/etc|/sbin|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  439.     *)
  440.       # OSF1 and SCO ODT 3.0 have their own names for install.
  441.       for ac_prog in installbsd scoinst install; do
  442.         if test -f $ac_dir/$ac_prog; then
  443.       if test $ac_prog = install &&
  444.             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
  445.         # AIX install.  It has an incompatible calling convention.
  446.         # OSF/1 installbsd also uses dspmsg, but is usable.
  447.         :
  448.       else
  449.         INSTALL="$ac_dir/$ac_prog -c"
  450.         break 2
  451.       fi
  452.     fi
  453.       done
  454.       ;;
  455.     esac
  456.   done
  457.   IFS="$ac_save_ifs"
  458. fi
  459.  
  460. if test -z "$INSTALL"; then
  461.   # As a last resort, use the slow shell script.
  462.   for ac_dir in ${srcdir} ${srcdir}/.. ${srcdir}/../..; do
  463.     if test -f $ac_dir/install.sh; then
  464.       INSTALL="$ac_dir/install.sh -c"; break
  465.     fi
  466.   done
  467. fi
  468. if test -z "$INSTALL"; then
  469.   echo "configure: can not find install.sh in ${srcdir} or ${srcdir}/.. or ${srcdir}/../.." >&2; exit 1
  470. fi
  471. test -n "$verbose" && echo "    setting INSTALL to $INSTALL"
  472.  
  473. # Use test -z because SunOS4 sh mishandles ${INSTALL_PROGRAM-'${INSTALL}'}.
  474. # It thinks the first close brace ends the variable substitution.
  475. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
  476. test -n "$verbose" && echo "    setting INSTALL_PROGRAM to $INSTALL_PROGRAM"
  477.  
  478. test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
  479. test -n "$verbose" && echo "    setting INSTALL_DATA to $INSTALL_DATA"
  480.  
  481. if test -z "$RANLIB"; then
  482.   # Extract the first word of `ranlib', so it can be a program name with args.
  483.   set ac_dummy ranlib; ac_word=$2
  484.   test -n "$silent" || echo "checking for $ac_word"
  485.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  486.   for ac_dir in $PATH; do
  487.     test -z "$ac_dir" && ac_dir=.
  488.     if test -f $ac_dir/$ac_word; then
  489.       RANLIB="ranlib"
  490.       break
  491.     fi
  492.   done
  493.   IFS="$ac_save_ifs"
  494. fi
  495. test -z "$RANLIB" && RANLIB=":"
  496. test -n "$RANLIB" && test -n "$verbose" && echo "    setting RANLIB to $RANLIB"
  497.  
  498.  
  499. if test -z "$CC"; then
  500.   # Extract the first word of `gcc', so it can be a program name with args.
  501.   set ac_dummy gcc; ac_word=$2
  502.   test -n "$silent" || echo "checking for $ac_word"
  503.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  504.   for ac_dir in $PATH; do
  505.     test -z "$ac_dir" && ac_dir=.
  506.     if test -f $ac_dir/$ac_word; then
  507.       CC="gcc"
  508.       break
  509.     fi
  510.   done
  511.   IFS="$ac_save_ifs"
  512. fi
  513. test -z "$CC" && CC="cc"
  514. test -n "$CC" && test -n "$verbose" && echo "    setting CC to $CC"
  515.  
  516. # Find out if we are using GNU C, under whatever name.
  517. cat > conftest.c <<EOF
  518. #ifdef __GNUC__
  519.   yes
  520. #endif
  521. EOF
  522. ${CC-cc} -E conftest.c > conftest.out 2>&1
  523. if egrep yes conftest.out >/dev/null 2>&1; then
  524.   GCC=1 # For later tests.
  525. fi
  526. rm -f conftest*
  527.  
  528. test -n "$silent" || echo "checking how to run the C preprocessor"
  529. if test -z "$CPP"; then
  530.   # This must be in double quotes, not single quotes, because CPP may get
  531.   # substituted into the Makefile and ``${CC-cc}'' will simply confuse
  532.   # make.  It must be expanded now.
  533.   CPP="${CC-cc} -E"
  534.   cat > conftest.${ac_ext} <<EOF
  535. #include "confdefs.h"
  536. #include <stdio.h>
  537. Syntax Error
  538. EOF
  539. # Some shells (Coherent) do redirections in the wrong order, so need
  540. # the parens.
  541. ac_err=`eval "($ac_cpp conftest.${ac_ext} >/dev/null) 2>&1"`
  542. if test -z "$ac_err"; then
  543.   :
  544. else
  545.   rm -rf conftest*
  546.   CPP="${CC-cc} -E -traditional-cpp"
  547.   cat > conftest.${ac_ext} <<EOF
  548. #include "confdefs.h"
  549. #include <stdio.h>
  550. Syntax Error
  551. EOF
  552. # Some shells (Coherent) do redirections in the wrong order, so need
  553. # the parens.
  554. ac_err=`eval "($ac_cpp conftest.${ac_ext} >/dev/null) 2>&1"`
  555. if test -z "$ac_err"; then
  556.   :
  557. else
  558.   rm -rf conftest*
  559.   CPP=/lib/cpp
  560. fi
  561. rm -f conftest*
  562. fi
  563. rm -f conftest*
  564. fi
  565. test -n "$verbose" && echo "    setting CPP to $CPP"
  566.  
  567.  
  568. echo checking for signed size_t type
  569. echo '#include <stddef.h>
  570. FOOBAR __SIZE_TYPE__ FOOBAR' > conftest.c
  571. eval "$CPP conftest.c 2>/dev/null" \
  572. | grep '^FOOBAR.*unsigned.*FOOBAR$' >/dev/null \
  573. || {
  574.     DEFS="$DEFS -U__SIZE_TYPE__ -D__SIZE_TYPE__=unsigned"
  575.   (echo '#undef __SIZE_TYPE__';
  576.    echo '#define __SIZE_TYPE__ unsigned') >> confdefs.h
  577.   test -n "$verbose" && echo '    using unsigned int for size_t'
  578. }
  579. rm -f conftest*
  580.  
  581. test -n "$silent" || echo "checking for libc-friendly stddef.h"
  582. cat > conftest.${ac_ext} <<EOF
  583. #include "confdefs.h"
  584. #define __need_size_t
  585. #define __need_wchar_t
  586. #include <stddef.h>
  587. #define __need_NULL
  588. #include <stddef.h>
  589. int main() { return 0; }
  590. int t() { size_t size; wchar_t wchar;
  591. #ifdef offsetof
  592. #error stddef.h ignored __need_*
  593. #endif
  594. if (&size == NULL || &wchar == NULL) abort ();; return 0; }
  595. EOF
  596. if eval $ac_compile; then
  597.   rm -rf conftest*
  598.   config_vars="$config_vars
  599. stddef.h = # The installed <stddef.h> seems to be libc-friendly."
  600. test -n "$verbose" && echo '    installed stddef.h looks friendly'
  601.  
  602. fi
  603. rm -f conftest*
  604.  
  605.  
  606.  
  607. echo 'checking for need to use -P to assemble .S files'
  608. cat > conftest.S <<EOF
  609. #include "confdefs.h"
  610. /* Nothing whatsoever.  */
  611. EOF
  612. ${CC-cc} $CFLAGS -c conftest.S 2>/dev/null || {
  613.   config_vars="$config_vars
  614. asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives."
  615.   test -n "$verbose" && echo '    using -P flag'
  616. }
  617. rm -f conftest*
  618.  
  619. # Iterate over all the sysdep directories we will use, running their
  620. # configure fragments, and looking for a uname implementation.
  621. uname=
  622. for dir in $sysnames; do
  623.   if test -r $sysdep_dir/$dir/configure; then
  624.     echo running configure fragment for $dir
  625.     . $sysdep_dir/$dir/configure
  626.   fi
  627.   test ! "$uname" && \
  628.   test -r $sysdep_dir/$dir/uname.c -o -r $sysdep_dir/$dir/uname.S && uname=$dir
  629. done
  630.  
  631. # If we will use the generic uname implementation, we must figure out what
  632. # it will say by examining the system, and write the results in config-name.h.
  633. if [ "$uname" = generic ]; then
  634.  
  635.   echo trying to guess OS release and version for uname
  636.  
  637.   kernel_release=
  638.   kernel_version=
  639.  
  640.   if [ ! "$release" -o ! "$version" ]; then
  641.     if [ -r /vmunix ]; then
  642.       kernel_id=`strings /vmunix | grep UNIX`
  643.     elif [ -r /dynix ]; then
  644.       kernel_id=`strings /dynix | grep DYNIX`
  645.     else
  646.       kernel_id=
  647.     fi
  648.     if [ "$kernel_id" ]; then
  649.       kernel_release=`echo "$kernel_id" | sed 's/^[^0-9.]*\([0-9.]*\).*$/\1/'`
  650.       kernel_version=`echo "$kernel_id" | sed 's/^[^#]*#\([0-9]*\).*$/\1/'`
  651.     fi
  652.   fi
  653.  
  654.   sysname=`echo $os | sed 's/[0-9.]*$//'`
  655.   if [ $sysname != $os ]; then
  656.     config_release=`echo $os | sed s/$sysname//`
  657.   fi
  658.  
  659.   if [ "$release" ]; then
  660.     # All is well.
  661.     true
  662.   elif [ x`echo "$config_release" | sed "s/^$kernel_release//"` \
  663.      != x$config_release ]; then
  664.     # The configuration release is a substring of the kernel release.
  665.     release=$kernel_release
  666.   elif [ x$config_release != x ]; then
  667.     release=$config_release
  668.   elif [ x$kernel_release != x ]; then
  669.     release=$kernel_release
  670.   else
  671.     cat <<END
  672. I don't know what release of $sysname you are using.  Please enter the
  673. release number now.  This information is used only for the \`uname' function,
  674. so it is not critical.
  675. END
  676.     read release
  677.     if [ ! "$release" ]; then
  678.       release=unknown
  679.     fi
  680.   fi
  681.  
  682.   if [ "$version" ]; then
  683.     # All is well.
  684.     true
  685.   elif [ ! "$kernel_version" ]; then
  686.     cat <<END
  687. I don't know what version of $sysname $release you are using.  Please enter
  688. the version number now.  This information is used only for the uname
  689. function, so it is not critical.
  690. END
  691.     read version
  692.     if [ ! "$version" ]; then
  693.       version=unknown
  694.     fi
  695.   else
  696.     version=$kernel_version
  697.   fi
  698.  
  699.   cat > config-name.h <<END
  700. /* This file was generated automatically by configure.  Do not edit.
  701.    This is used by the generic uname function.  */
  702. #define UNAME_SYSNAME "${sysname}"
  703. #define UNAME_RELEASE "${release}"
  704. #define UNAME_VERSION "${version}"
  705. #define UNAME_MACHINE "${config_machine}-${config_vendor}"
  706. END
  707.  
  708.   system_name="$sysname $release version $version on $vendor $machine"
  709. else
  710.   # Not generic uname.  We don't need config-name.h at all.
  711.   system_name=$config
  712. fi
  713.  
  714. if [ "$gnu_ld" ]; then
  715.   DEFS="$DEFS -DHAVE_GNU_LD"
  716. fi
  717. if [ "$gnu_as" ]; then
  718.   DEFS="$DEFS -DHAVE_GNU_AS"
  719. fi
  720.  
  721. (
  722.   echo '# This file was generated automatically by configure.  Do not edit.'
  723.   echo '# Put configuration parameters in configparms instead.'
  724.   echo "config-machine = ${config_machine}"
  725.   echo "config-vendor = ${config_vendor}"
  726.   echo "config-os = ${config_os}"
  727.   echo "config-sysdirs = ${sysnames}"
  728.   if [ "$prefix" ]; then
  729.     echo "prefix = ${prefix}"
  730.   fi
  731.   if [ "$exec_prefix" ]; then
  732.     echo "exec_prefix = ${exec_prefix}"
  733.   fi
  734.   echo "config-defines = ${DEFS}"
  735.   for var in INSTALL INSTALL_PROGRAM INSTALL_DATA RANLIB; do
  736.     eval "echo \"${var} = \${$var}\""
  737.   done
  738.   echo "$config_vars"
  739. ) > config.make
  740. echo "Wrote config.make in $PWD."
  741.  
  742. if [ $srcdir != . ]; then
  743.   if [ $srcdir = .. ]; then
  744.     cwd=`pwd`
  745.     objdir=`basename $cwd`
  746.   else
  747.     objdir=`pwd`
  748.   fi
  749.   cat > Makefile <<END
  750. # This file was generated automatically by configure.  Do not edit.
  751. srcdir = $srcdir
  752.  
  753. all .DEFAULT:
  754.     \$(MAKE) -C \$(srcdir) objdir=\`pwd\` \$@
  755. END
  756.  
  757. echo "Wrote Makefile in $PWD."
  758. fi
  759.  
  760. cat > config.status <<END
  761. #!/bin/sh
  762. # This file was generated automatically by configure.  Do not edit.
  763. # The GNU C library was configured in $PWD for
  764. # $system_name as follows:
  765. release=$release version=$version $0 $configure_args \$*
  766. END
  767. chmod a+x config.status
  768. echo "Wrote config.status in $PWD."
  769.  
  770. exit 0
  771. s%@INSTALL@%$INSTALL%g
  772. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  773. s%@INSTALL_DATA@%$INSTALL_DATA%g
  774. s%@RANLIB@%$RANLIB%g
  775. s%@CC@%$CC%g
  776. s%@CPP@%$CPP%g
  777. INSTALL='$INSTALL'
  778. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  779. INSTALL_DATA='$INSTALL_DATA'
  780. RANLIB='$RANLIB'
  781. CC='$CC'
  782. CPP='$CPP'
  783.